<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<div class="pad-lr-10">

<form name="myform" action="?m=admin&c=siteSetting&a=del_all" method="post" onsubmit="return confirm('<?php echo L('siteSetting_confirm')?>')">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th  align="center" width="20"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
			<th align="center" width="60">ID</th>
			<th align="center"><?php echo L('siteSetting_name')?></th>
			<th align="center"><?php echo L('siteSetting_description')?></th>
			<th align="center"><?php echo L('siteSetting_operation')?></th>
		</tr>
	</thead>
<tbody>
<?php
	foreach($label as $k=>$v) {
?>
    <tr>
		<td align="center"><input type="checkbox" value="<?php echo $v['id']?>" name="id[]"></td>
		<td align="center"><?php echo $v['id']?></td>
		<td align="center"><?php echo $v['s_key']?></td>
		<td align="center"><?php echo $v['description']?></td>
		<td align="center">
		<a href="javascript:edit('<?php echo $v['id']?>')"><?php echo L('siteSetting_edit')?></a> | 
		 <a href="javascript:void(0)"  onclick="label_delete(this,'<?php echo $v['id']?>','<?php echo $v['s_key'];?>')"><?php echo L('siteSetting_del')?></a>
		
		 </td>
    </tr>
<?php
	}

?>
</tbody>
</table>

<div class="btn">
<label for="check_box"><a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('select_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a></label> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>"/>
</div>
<div id="pages"><?php echo $pages?></div>
</div>
</form>
</div>
<script type="text/javascript">
<!--
function edit(id) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'<?php echo L('siteSetting_edit_val')?>',id:'edit',iframe:'?m=admin&c=siteSetting&a=edit&id='+id,width:'580',height:'420'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function label_delete(obj,id,s_key){
	 window.top.art.dialog({content:'<?php echo L('siteSetting_del_confirm')?>', fixed:true, style:'confirm', id:'att_delete'},
	function(){
	$.get('?m=admin&c=siteSetting&a=del&id='+id+'&s_key='+s_key+'&pc_hash=<?php echo $_SESSION['pc_hash']?>',function(data){
				if(data == 1) $(obj).parent().parent().fadeOut("slow");
			})
		 	
		 }, 
	function(){});
};

window.top.$('#display_center_id').css('display','none');
//-->
</script>
</body>
</html>